]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
search: Do not use Cancellable.reset()
authorMarco Trevisan (Treviño) <mail@3v1n0.net>
Mon, 16 Feb 2026 20:58:25 +0000 (21:58 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Sat, 14 Mar 2026 17:31:14 +0000 (18:31 +0100)
Cancellable reset API is deprecated for long time and it's quite broken.
In fact if a search provider receives a cancelled event may end up
checking if the cancellable has been cancelled, but this may not be true
anymore after a reset.

Use instead new cancellable instances so that once one is used we can
consider the previous one completed and we can forget about it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/4080>
(cherry picked from commit cead829503083658e736af5964d1d8eb3c92a6bb)

js/ui/search.js

index 3333e042d40e9360e51f3ff0296981c420297f2e..ac5401566e22b094488deca7535dea6582925db6 100644 (file)
@@ -225,7 +225,7 @@ const SearchResultsBase = GObject.registerClass({
             return;
 
         this._cancellable.cancel();
-        this._cancellable.reset();
+        this._cancellable = new Gio.Cancellable();
 
         const metas = await this.provider.getResultMetas(metasNeeded, this._cancellable);
 
@@ -743,7 +743,7 @@ export const SearchResultsView = GObject.registerClass({
         this._startingSearch = true;
 
         this._cancellable.cancel();
-        this._cancellable.reset();
+        this._cancellable = new Gio.Cancellable();
 
         if (terms.length === 0) {
             this._reset();